﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
using System.Text;

namespace Extend.Formatter
{
    public class FormatterSample : MonoBehaviour
    {
        void Start()
        {

        }

        void Update()
        {
            int i = Random.Range(0, 100);
            float f = Random.Range(0.01f, 200.01f);
            float d = Random.Range(0.01f, 200.01f);
            string s = "00: " + i.ToString();

            Profiler.BeginSample("string.format");
            string s1 = string.Format("{0}{1}{2}{3}", i, f, d, s);
            Profiler.EndSample();

            Profiler.BeginSample("string.Write");
            string s2 = StringFormatter.Format("{0}{1}{2}{3}", i, f, d, s);
            Profiler.EndSample();

        }
        
    }

}
